<template>
  <div>
    <DetailBanner :sightName='sightName' :bannerImg='bannerImg' :gallaryImgs='gallaryImgs'></DetailBanner>
    <DetailHeader></DetailHeader>
    <DetailListr :list='list'></DetailListr>
    <div class="content"></div>
  </div>
</template>

<script>
import DetailBanner from './components/Banner'
import DetailHeader from './components/Header'
import DetailListr from './components/List'
import axios from 'axios'
export default {
  name: 'Detail',
  components: {
    DetailBanner,
    DetailHeader,
    DetailListr
  },
  methods: {
    getDate () {
      axios.get('/api/detail.json', {
        params: {
          id: this.$route.params.id
        }
      }).then(this.detailDate)
    },
    detailDate (res) {
      res = res.data
      if (res.data && res.ret) {
        this.sightName = res.data.sightName
        this.bannerImg = res.data.bannerImg
        this.gallaryImgs = res.data.gallaryImgs
        this.list = res.data.categoryList
      }
    }
  },
  activated () {
    this.getDate()
  },
  data () {
    return {
      list: [],
      sightName: '',
      gallaryImgs: '',
      bannerImg: ''
    }
  }
}
</script>

<style lang='stylus' scoped>
  .content
    height: 50rem
</style>
